// 对象转成指定字符串分隔
export function listToString(baseUrl, list, separator) {
  let strs = "";
  separator = separator || ",";
  for (let i in list) {
    if (list[i].url) {
      strs += list[i].url.replace(baseUrl, "") + separator;
    }
  }
  return strs != '' ? strs.substr(0, strs.length - 1) : '';
}

// 对象转成指定字符串分隔
export function splitImages(fileList) {
  if(fileList.length>0){
    // 将封面图片变更为分号分隔字符
    var imageArr = [];
    for (var i = 0; i < fileList.length; i++) {
      imageArr.push(fileList[i].fileName);
    }
    return imageArr.join(';');
  }
  return undefined;
}

export function splitObject(obj) {
  if(obj.length>0){
    var imageArr = [];
    for (var i = 0; i < obj.length; i++) {
      imageArr.push(obj[i]);
    }
    return imageArr.join(';');
  }
  return undefined;
}

export function addPath(url) {
  return "https://sjyy.yczwsj.com"+url;
}
